#!/usr/bin/node

const fs = require('fs'),
      src = process.argv[2],
      dts = process.argv[3];
try{

  let src1 = fs.openSync(src,'r');
  let dts1 = fs.openSync(dts,'w');
  let size = fs.statSync(src).size;

  let buffer = new Buffer(size);
  fs.readSync(src1,buffer,0,size,0);
  fs.writeSync(dts1,buffer,0,size,0);

  fs.closeSync(src1);
  fs.closeSync(dts1);

  //修改权限
  fs.chmodSync(dts, fs.statSync(src).mode);

}catch(e){
  console.error(e.message);
  process.exit(1);
}
